package twentyThreePattern.StructuralPattern7.proxy.DynamicProxy.section3;

import java.lang.reflect.InvocationHandler;

public class SubjectDynamicProxy extends DynamicProxy {
	
	public static  <T> T newInstance(Object obj){
		Class<?> clazz = obj.getClass();
		ClassLoader loader = clazz.getClassLoader();
		Class<?>[] interfaces = clazz.getInterfaces();
		InvocationHandler h = new MyInvocationHandler(obj);
		
		return newInstance(loader, interfaces, h);
	} 

}
